﻿namespace FSharpChess

module Funcs2 =
    //move further
    let mutable IsInAnalyseMode = false
    let mutable IsPondering = false
    let Stage(psn) =
        if psn.Wct > 14 && psn.Bct > 14 then
            Opening
        elif psn.Wct <8 && psn.Bct < 8 then
            End
        else
            Middle
    let HasMoved (pcid,psn) = psn.Pcs.[pcid].NoOfMoves <> 0 ||  psn.Pcs.[pcid].SquareOrd = -1 

    let IsThinking(pr) =
        pr.ThreadThought <> null 
    let CompareMove = 
        let CompMove (move1, move2) =
            if (move1.Score < move2.Score) then 1
            elif (move1.Score > move2.Score) then -1
            else 0
        { new System.Collections.Generic.IComparer<Move> with member this.Compare(x,y) = CompMove(x,y) }
